package com.vnaloha.common.service;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.multipart.MultipartFile;

import com.vnaloha.common.model.Gallery;
import com.vnaloha.common.model.Paging;

public interface GalleryService {
	
	/**
	 * Save gallery to database and save file to directory
	 * @param request http request
	 * @param file multipartFile 
	 * @param gallery object {@link Gallery}
	 * @return true if successfully
	 */
	public boolean save(HttpServletRequest request, MultipartFile file ,Gallery gallery);
	
	/**
	 * Get gallery by id
	 * @param id this is gallery id
	 * @return object {@link Gallery}
	 */
	public Gallery get(int id);
	
	/**
	 * Get all gallery in database
	 * @return a list {@link Gallery}
	 */
	public List<Gallery> list();
	
	/**
	 * Get list gallery by {@link Paging}
	 * @param paging object {@link Paging}
	 * @return a list {@link Gallery}
	 */
	public List<Gallery> list(Paging paging);
	
	/**
	 * Delete gallery by id
	 * @param id this is gallery id
	 * @param request http request
	 * @return true if successfully
	 */
	public boolean delete(int id, HttpServletRequest request);
	
	/**
	 * Delete many record by list string
	 * @param listId a list id by string 
	 * @param request http request
	 * @return <code>true</code> if successfully.
	 */
	public boolean deleteByListId(String listId, HttpServletRequest request);
	
}
